﻿namespace Sai.Core
{
	using System.Xml.Serialization;
	using Sai.Core.Introspection;

	/// <summary>
	/// Represents a type marked as obsolete between versions.
	/// </summary>
	public class ObsoleteTypeDifference
	{
		/// <summary>
		/// Initializes a new instance of the <see cref=" ObsoleteTypeDifference"/> class.
		/// </summary>
		public ObsoleteTypeDifference()
		{
		}

		/// <summary>
		/// Initializes a new instance of the <see cref=" ObsoleteTypeDifference"/> 
		/// class. Using type name and reason message.
		/// </summary>
		/// <param name="t">The type</param>
		/// <param name="message">The message</param>
		public ObsoleteTypeDifference(TypeName t, string message)
		{
			this.Name = t.Name;
			this.Namespace = t.Namespace;
            this.FullName = t.FullName.ToString();
			this.Message = message;
		}

		/// <summary>
		/// The name of the type
		/// </summary>
		[XmlAttribute("Name")]
		public string Name { get; set; }

		/// <summary>
		/// The containing namespace
		/// </summary>
		[XmlAttribute("Namespace")]
		public string Namespace { get; set; }

        /// <summary>
        /// The fully qualified name of the type
        /// </summary>
        [XmlAttribute("FullName")]
        public string FullName { get; set; }

		/// <summary>
		/// The reason (if any) for obsoleting the type
		/// </summary>
		[XmlAttribute("Message")]
		public string Message { get; set; }
	}
}
